#include <stdio.h>
#include <signal.h>

static void sig_process( int sig )
{
	printf( "SIG [ %d ].\n", sig );	
}

int main( void )
{
	struct sigaction sa;

	sa.sa_flags |= SA_NODEFER;
	sa.sa_handler = sig_process;

	sigemptyset( &sa.sa_mask );

	sigaddset( &sa.sa_mask, SIGUSR1 );
	sigaddset( &sa.sa_mask, SIGUSR2 );

	sigprocmask( SIG_BLOCK, &sa.sa_mask, NULL );

	if ( -1 == ( sigaction( SIGUSR2, &sa, NULL ) ) )
		return -1;


	if ( -1 == ( sigaction( 22, &sa, NULL ) ) )
		return -1;

	for ( ; ; )
		pause();

	return 0;

}
